package twelve.decorator.example;

import java.io.UnsupportedEncodingException;

public class SideBorder extends Border{
    private char borderChar;
    public SideBorder(Display display,char ch){
        super(display);
        this.borderChar = ch;
    }
    @Override
    public int getColumns() throws UnsupportedEncodingException {
        return 1 +display.getColumns() +1;
    }

    @Override
    public int getRows() {
        return display.getRows();
    }

    @Override
    public String getRowText(int row) throws UnsupportedEncodingException {
        return borderChar + display.getRowText(row) + borderChar;
    }
}
